﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <meta name="MobileOptimized" content="320" />
    <meta name="format-detection" content="telephone=no" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>盘中直击</title>
    <style type="text/css">
        .cpbj_say {
            padding: 8px 10px;
            background: #fff;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            margin: 10px 0;
            border: 1px solid #e7e7e7;
            position: relative;
        }

        .new_date {
            color: #ccc;
            font-size: 12px;
            line-height: 18px;
            padding-bottom: 5px;
        }

        .more_bar {
            background: url("@Url.Content("~/Static/Image/iocn02.png")") no-repeat scroll center bottom rgba(0, 0, 0, 0);
            color: #979696;
            height: 30px;
            line-height: 30px;
            padding-bottom: 5px;
            text-align: center;
        }
    </style>
    <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")"></script>
    <script src="@Url.Content("~/Scripts/Session.js")"></script>
    @* <link href="@Url.Content("~/css/style.css?type=1")" rel="stylesheet" type="text/css">*@
    @*<script src="~/Scripts/common.js?type=1"></script>
    <script src="~/Scripts/session.js"></script>
    <script type="text/javascript" name="baidu-tc-cerfication" src="http://apps.bdimg.com/cloudaapi/lightapp.js#73f6414425a6e62cc8f124dccf517b3e"></script>
    <script type="text/javascript">window.bd && bd._qdc && bd._qdc.init({ app_id: '9a50c573b800cbe88dd54c05' });</script>*@
</head>
<body>
    <script type="text/javascript">
        var www = "@Url.Content("~")";
        var isbusy = true;
        var meid = "@ViewBag.key";
        var lday = "@ViewBag.lday";
        var day = lday;
        $(function () {
            var n = em.session.get("list0_pindex");
            if (!isnull(n)) day = parseInt(n, 10);
            $("body").addClass("bw");
            $(".more_bar").click(function () {
                if (!isbusy)
                    getData(-1);
            });
            $(".backtop").click(function () {
                if (!isbusy) {
                    if (day != lday) {
                        getData(1);
                    }
                }
            });
            getData(0);
        });
        function getData(tmppre) {
            isbusy = true;
            $(".more_bar").addClass("load");
            $(".more_bar").html("正在加载...");
            $.get(www + "News/getPubNewsByDay", { meid: meid, day: day, pre: tmppre }, function (d) {
                $(".more_bar").removeClass("load");
                $(".more_bar").html("点击浏览更多");
                if (d == "timeout" || d == "error") {

                } else if (d == "") {
                    showMore(false);
                } else {
                    var html = "";
                    var list = eval(d);
                    if (list.length > 0) {
                        for (var i = 0; i < list.length; i++) {
                            html += '<div class="cpbj_say max_320"><div class="say"></div><p class="new_date">' + getDate2(list[i]["pubDate"]) + '</p>' + list[i]["Content"] + '</div>';
                        }
                        $("#list").html(html);
                        $("#list").find("a").each(function (i, n) {
                            var src = $(this).attr("href");
                            if (src) {
                                if (src.indexOf("{[openid]}") != -1) {
                                    src = src.replace("{[openid]}", "@ViewBag.openid");
                                    $(this).attr("href", src);
                                }
                            }
                        });
                        day = list[0]["pubDate"].substr(0, 10);
                        if (day != lday) $(".backtop").css("display", ""); else $(".backtop").css("display", "none");
                        showMore(true);
                    } else showMore(false);
                }
                isbusy = false;
            });
    }
    function getDate2(str) {
        str = str.replace(/-/g, "/").replace(/T/g, " ").substr(0, 19);
        return str;
    }
    function showMore() {
        $(".more_bar").css("display", arguments[0] ? "block" : "none");
    }
    </script>
    <div class="cpbj_sayk">
        <div id="list">
        </div>
        <div class="more_bar">点击浏览更多</div>
    </div>
    <div class="backtop" style="display: none;"><a href="#">上一页</a></div>
</body>
</html>
